package com.server.pinggu.service.impl;

import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import org.apache.commons.lang3.StringUtils;
import com.server.pinggu.mapper.SenUseractiveMapper;
import com.server.pinggu.domain.SenUseractive;
import com.server.pinggu.service.ISenUseractiveService;

import java.util.List;

/**
 * 【请填写功能名称】Service业务层处理
 *
 * @author ltao
 * @date 2022-10-23
 */
@Service
public class SenUseractiveServiceImpl extends ServiceImpl<SenUseractiveMapper, SenUseractive> implements ISenUseractiveService {

    @Override
    public List<SenUseractive> queryList(SenUseractive senUseractive) {
        LambdaQueryWrapper<SenUseractive> lqw = Wrappers.lambdaQuery();
        if (senUseractive.getUid() != null){
            lqw.eq(SenUseractive::getUid ,senUseractive.getUid());
        }
        if (StringUtils.isNotBlank(senUseractive.getDdate())){
            lqw.eq(SenUseractive::getDdate ,senUseractive.getDdate());
        }
        if (StringUtils.isNotBlank(senUseractive.getPage())){
            lqw.eq(SenUseractive::getPage ,senUseractive.getPage());
        }
        if (StringUtils.isNotBlank(senUseractive.getUrl())){
            lqw.eq(SenUseractive::getUrl ,senUseractive.getUrl());
        }
        if (senUseractive.getDtime() != null){
            lqw.eq(SenUseractive::getDtime ,senUseractive.getDtime());
        }
        if (senUseractive.getNums() != null){
            lqw.eq(SenUseractive::getNums ,senUseractive.getNums());
        }
        if (StringUtils.isNotBlank(senUseractive.getIp())){
            lqw.eq(SenUseractive::getIp ,senUseractive.getIp());
        }
        if (StringUtils.isNotBlank(senUseractive.getTitle())){
            lqw.eq(SenUseractive::getTitle ,senUseractive.getTitle());
        }
        return this.list(lqw);
    }
}